package red.mlz.appconsumer.controller.sms;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import red.mlz.appconsumer.feign.sms.SmsFeign;
import red.mlz.common.utils.Response;

@RestController
@Slf4j
public class SmsController {

    @Autowired
    private SmsFeign smsFeign;

    //同步发送
    @RequestMapping("/sync-send")
    public Response syncSend(@RequestParam("phone") String phone){
        return new Response(1001,smsFeign.syncSend(phone));
    }

    //批量发送
    @RequestMapping("/batch-send")
    public Response batchSend(@RequestParam String phone) {
        return new Response(1001,smsFeign.batchSend(phone));
    }

    //异步发送
    @RequestMapping("/async-send")
    public Response asyncSend(@RequestParam("phone") String phone) {
        return new Response(1001,smsFeign.asyncSend(phone));
    }
}
